package com.blkj.common.exception.base;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author 北浪 2021/11/22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BaseException extends RuntimeException{

    /**
     * 用户名
     */
    private String username;

    /**
     * 错误码
     */
    private String code;


    /**
     * 错误消息
     */
    private String defaultMessage;

    public BaseException(){}

    public BaseException(String username,String code, String defaultMessage) {
        this.username = username;
        this.code = code;
        this.defaultMessage = defaultMessage;
    }

    public BaseException(String code, String defaultMessage) {
        this.code = code;
        this.defaultMessage = defaultMessage;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDefaultMessage() {
        return defaultMessage;
    }

    public void setDefaultMessage(String defaultMessage) {
        this.defaultMessage = defaultMessage;
    }
}
